package com.yuwen.yuwenRPC.registry;

/**
 * @ClassNameRegistryServiceCache
 * @Description TODO
 * @Author钰玟
 * @Date2025/4/1 下午4:22
 * @Version 1.0
 **/

import com.yuwen.yuwenRPC.model.ServiceMetaInfo;

import java.util.List;

/**
 * 服务的本地缓存
 */
public class RegistryServiceCache {
    /**
     * 服务缓存 已废弃 单个服务
     */
    @Deprecated
    List<ServiceMetaInfo> serviceCache;



    /**
     * 将服务写入本地缓存
     * @param newServiceCache 存入的本地缓存
     */
    void writeCache(List<ServiceMetaInfo> newServiceCache){
        System.err.println("@@@@@Not Cache");
        this.serviceCache = newServiceCache;
    }

    /**
     * 读取本地服务缓存
     * @return 指定的服务
     */
    List<ServiceMetaInfo> readServiceCache(){
        return this.serviceCache;
    }

    /**
     * 清空缓存
     */
    void clearCache(){
        this.serviceCache.clear();
    }
}
